//
// Created by mio on 25-5-13.
//

#ifndef AUDIOENCODER_H
#define AUDIOENCODER_H

#include "AV_Common.h"
class AudioResampler;

class AACEncoder : public EncodBase
{
public:
    AACEncoder();
    AACEncoder(const AACEncoder&) = delete;
    AACEncoder& operator=(const AACEncoder&) = delete;
    ~AACEncoder();
public:
    virtual bool Open(AVConfig& config) override;
    virtual void Close() override;
    uint32_t     GetFrameSamples();
    AVPacketPtr  Encode(const uint8_t *pcm, int samples);
private:
    int64_t pts_ = 0;
    std::unique_ptr<AudioResampler> audio_resampler_;
};


#endif //AUDIOENCODER_H
